import request from '@/utils/httpRequest'
// 创建保存规格信息
export function attributeCreate(query) {
  return request({
    url: '/bsnl-product/attribute/create',
    method: 'post',
    data: query
  })
}
// 更新规格信息
export function attributeUpdate(query) {
  return request({
    url: '/bsnl-product/attribute/update',
    method: 'post',
    data: query
  })
}
// 查询单个规格信息(根据id)
export function getAttributeById(id) {
  return request({
    url: '/bsnl-product/attribute/' + id,
    method: 'get'
  })
}
// 删除/恢复规格(根据id)
export function editAttributeDeleteFlagById(query) {
  return request({
    url: '/bsnl-product/attribute/delete',
    method: 'post',
    data: query
  })
}
// 获取全部的规格信息
export function attributeList(query) {
  return request({
    url: '/bsnl-product/attribute/list',
    method: 'get',
    params: query
  })
}

// 通过商品类型Id获取规格列表
export function getAttributesByGoodsTypeId(id, query) {
  return request({
    url: '/bsnl-product/goodsType/attribute/' + id,
    method: 'get',
    params: query
  })
}

// 通过商品类别查找规格
export function getAttributesByGoodsType(query) {
  return request({
    url: '/bsnl-product/category/list',
    method: 'get',
    params: query
  })
}
// 通过规格名查询规格
export function getAttributeByName(id, query) {
  return request({
    url: '/bsnl-product/attribute/name/',
    method: 'get',
    params: query
  })
}
// 模糊查询规格信息
export function attributeQuery(query) {
  return request({
    url: '/bsnl-product/attribute/query',
    method: 'post',
    data: query
  })
}
